package com.supper;

import com.supper.annotation.PersonAnn;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.temporal.ChronoUnit;

/**
 * @author yutao
 * @since 2020/4/13 2:50 下午
 */
public class AnnotationTest {

    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-ann-context.xml");

        PersonAnn personAnn = (PersonAnn) applicationContext.getBean("personAnn");
        System.out.println(personAnn);
        System.out.println(personAnn.getCarAnn());


        LocalDateTime now = LocalDateTime.now();
        LocalDateTime now1 = LocalDateTime.now();
        long until = now.until(now1, ChronoUnit.DAYS);
        System.out.println(until);

    }

}
